var rootview = ui("$");
var helperOpen = require("helper/open");
var aLayoutMore = ui("do_ALayout_more");
var gvAout01 = ui("gvAout01");
var gvAout02 = ui("gvAout02");
var gvAout03 = ui("gvAout03");
var gvAout04 = ui("gvAout04");
var gvAout05 = ui("gvAout05");
rootview.setMapping({
	"gvTitle01.text" : "gvTitle01",
	"gvAout01.tag" : "gvId01",
	"gvSubTitle01.text":"gvSubTitle01",
	"gvImg01.source":"gvImg01",
	"gvTitle02.text" : "gvTitle02",
	"gvAout02.tag" : "gvId02",
	"gvSubTitle02.text":"gvSubTitle02",
	"gvImg02.source":"gvImg02",
	"gvTitle03.text" : "gvTitle03",
	"gvAout03.tag" : "gvId03",
	"gvSubTitle03.text":"gvSubTitle03",
	"gvImg03.source":"gvImg03",
	"gvTitle04.text" : "gvTitle04",
	"gvAout04.tag" : "gvId04",
	"gvSubTitle04.text":"gvSubTitle04",
	"gvImg04.source":"gvImg04",
	"gvTitle05.text" : "gvTitle05",
	"gvAout05.tag" : "gvId05",
	"gvSubTitle05.text":"gvSubTitle05",
	"gvImg05.source":"gvImg05"
});

/*var mall02Title = ui("borderViewTitle");
var mall02ChildTitle = mall02Title.getView("center")
var mall02CenterTitle = ui(mall02ChildTitle);
var mall02Tag = {name:"圈圈直供",color:"14bac3FF",bgimg1:"source://image/mall/tit03.png",bgimg2:"source://image/mall/tit04.png"};
mall02CenterTitle.fire(mall02ChildTitle, {"tag":mall02Tag,"borderView":mall02Title.getAddress()});
*/

aLayoutMore.on("touch", function(data){
	helperOpen.open("source://view/mall/search/supplierSearch.ui",{type:1});
});

gvAout01.on("touch", function(data){
	 helperOpen.open("source://view/mall/search/mallSearch.ui",{supplierId:gvAout01.tag});
});
gvAout02.on("touch", function(data){
	 helperOpen.open("source://view/mall/search/mallSearch.ui",{supplierId:gvAout02.tag});
});
gvAout03.on("touch", function(data){
	 helperOpen.open("source://view/mall/search/mallSearch.ui",{supplierId:gvAout03.tag});
});
gvAout04.on("touch", function(data){
	 helperOpen.open("source://view/mall/search/mallSearch.ui",{supplierId:gvAout04.tag});
});
gvAout05.on("touch", function(data){
	 helperOpen.open("source://view/mall/search/mallSearch.ui",{supplierId:gvAout05.tag});
});

function openPage(n){
	var allData = JSON.parse(aLayoutTitle.tag);
	helperOpen.open("source://view/mall/search/mallSearch.ui",{supplierId:allData[n].id});
}